package com.zhongshengnetwork.rightbe.wzt.model;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.zhongshengnetwork.rightbe.CustomApplication;
import com.zhongshengnetwork.rightbe.common.CommonUtils;
import com.zhongshengnetwork.rightbe.gsonmodel.WeiShuInfoDetailModel;
import com.zhongshengnetwork.rightbe.wzt.activity.WZTActivity;
import com.zhongshengnetwork.rightbe.wzt.activity.WZTCardActivity;

public class WZTUtils {

    public static void goToWZT(Activity activity, WeiShuInfoDetailModel weiShuInfoDetailModel){

        if (CommonUtils.isLogin() == true && CustomApplication.loginModel.getUid().equals(weiShuInfoDetailModel.getUserid())){
            Intent intent = new Intent(activity, WZTActivity.class);
            Bundle bundle=new Bundle();
            bundle.putSerializable("model", weiShuInfoDetailModel);//序列化
            intent.putExtras(bundle);//发送数据
            activity.startActivity(intent);
        }else {
            Intent intent = new Intent(activity, WZTCardActivity.class);
            Bundle bundle=new Bundle();
            bundle.putSerializable("model", weiShuInfoDetailModel);//序列化
            intent.putExtras(bundle);//发送数据
            activity.startActivity(intent);
        }

    }

}
